/***********************************************
 This file is part of redia-bapps-main-ios.
 
 Copyright (c) 2015 Redia A/S
 
 Redia-bapps-main-ios is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 
 redia-bapps-main-ios is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with redia-bapps-main-ios.  If not, see <http://www.gnu.org/licenses/>.
 
 *********************************************** */

//
//  BAFetchHelper.h
//  redia-bapps-ios
//
//  Created by Nikolaj Tørring on 8/2/13.
//  Copyright (c) 2013 redia. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "JSONRPCClientDelegate.h"
#import "JSONRPCClient.h"

#define BA_REQID_GET_LIBRARIES 1
#define BA_REQID_SEARCH 2
#define BA_REQID_GET_OBJECTS 3
#define BA_REQID_VERSION 4
#define BA_REQID_AUTHENTICATE 5
#define BA_REQID_DEAUTHENTICATE 6
#define BA_REQID_IS_AUTHENTICATED 7
#define BA_REQID_GET_BRANCHES 8
#define BA_REQID_GET_MORE_IN_SAME_SERIES 9
#define BA_REQID_GET_RELATED_LOANS 10
#define BA_REQID_GET_ABOUT_CREATOR 11
#define BA_REQID_GET_REVIEWS 12
#define BA_REQID_GET_COVER_URLS 13
#define BA_REQID_GET_RESERVATIONS 14
#define BA_REQID_REMOVE_RESERVATIONS 15
#define BA_REQID_ADD_RESERVATION 16
#define BA_REQID_GET_AVAILABILITY 17
#define BA_REQID_RENEW_LOANS 18
#define BA_REQID_RENEW_ALL_LOANS 19
#define BA_REQID_GET_LOANS 20
#define BA_REQID_GET_OPENING_HOURS 21
#define BA_REQID_GET_MORE_BY_CREATOR 22
#define BA_REQID_LOAD_ALL_EVENTS 23
#define BA_REQID_LOAD_ALL_NEWS 24
#define BA_REQID_GET_POPULAR 25
#define BA_REQID_GET_OBJECT_BY_BARCODE_ID 26
#define BA_REQID_GET_LIBRARY_NAMES 27
#define BA_REQID_GET_LIBRARY_SETTINGS 28
#define BA_REQID_IS_SUPPORTED 29

#define IMF_REQID_CREATE_NEW_PACKAGE_ID 101
#define IMF_REQID_UPDATE_PACKAGE_ID 102
#define IMF_REQID_DELETE_PACKAGE 104
#define IMF_REQID_GET_PACKAGE 105
#define IMF_REQID_GET_PACKAGE_LIST 106
#define IMF_REQID_GET_SUGGESTED_PACKAGES 107
#define IMF_REQID_DELETE_IMAGE_PACKAGE 108
#define IMF_REQID_SEARCH_PACKAGES 109

#define LB_REQID_GET_OBJECT_ITEMS 200
#define LB_REQID_GET_OBJECT_ITEMS_HISTORY 201
#define LB_REQID_ADD_RESERVATION_FOR_PATRON 202
#define LB_REQID_LIBRARIAN_SEARCH 203
#define LB_REQID_GET_AUTOCOMPLETION_LIST 204

#define BA_RPC_ERROR_INVALID_SERVER_RESPONSE 90000
#define BA_RPC_ERROR_SERVER_RETURNED_UNEXPECTED_OBJECT 90001
#define BA_RPC_ERROR_UNKNOWN_RESPONSE 90002
#define BA_RPC_ERROR_REQUEST_FAILED 90003


typedef void(^BARpcResultBlock)(id);
typedef void(^BARpcErrorBlock)(int errorCode, NSString* errorMessage);

@interface BARPCHelper : NSObject<JSONRPCClientDelegate>

@property (strong, nonatomic) BARpcResultBlock resultBlock;
@property (strong, nonatomic) BARpcErrorBlock errorBlock;
//not used @property (strong, nonatomic) JSONRPCClient* client;




@end
